//
//  interface_network_data.h
//  testpcap
//
//  Created by bugforever on 1/14/15.
//  Copyright (c) 2015 bugforever. All rights reserved.
//

#ifndef __interface_network_data_h
#define __interface_network_data_h

enum NETWORK_DATA_TAG
{
    NDT_ETHERNET_DATA = 1,
    NDT_ARP_DATA,
    NDT_RARP_DATA,
    NDT_IP_DATA,
    NDT_ICMP_DATA,
    NDT_TCP_DATA,
    
    NDT_MAX = 0XFFFF,
};

class interface_network_data
{
public:
    virtual int add_ref() = 0;
    virtual int release() = 0;
    
    virtual unsigned char * get_raw_data() = 0;
    virtual int get_raw_data_size() = 0;
    
    virtual void set_tag( NETWORK_DATA_TAG tag , int data_offset ) = 0;
    
    virtual unsigned char * get_data_by_tag( NETWORK_DATA_TAG tag ) = 0;
    virtual int get_datasize_by_tag( NETWORK_DATA_TAG tag ) = 0;
    virtual int get_offset_by_tag( NETWORK_DATA_TAG tag ) = 0;
    
    virtual int append_data( unsigned char * ptr_data, int size ) = 0;
    
    virtual interface_network_data * duplicate() = 0;
};


#endif
